import { request } from '@/utils/request';
import api from '@/core/permission/modules/form/index';
/**
 * @description 获取表单列表
 * @returns
 */
export function getFormList(data) {
  return request({
    url: '/api/form/formList',
    method: 'post',
    data,
  });
}
/**
 * @description 获取表单属性
 * @returns
 */
export function getFormConf(data) {
  return request({
    url: '/api/form/getFormEntity',
    method: 'get',
    params:data,
  });
}
/**
 * @description 获取表单列表
 * @returns
 */
export function getFormTree() {
  return request({
    url: '/api/form/getFormTree',
    method: 'get',
  });
}

/**
 * @description 删除表单
 * @returns
 */
export function deleteForm(data) {
  return request(
    {
      url: '/api/form/deleteForm',
      method: 'post',
      data,
    },
    {
      successMsg: '删除成功',
    },
  );
}

/**
 * @description 创建表单
 * @returns
 */

// 增加表单
export function editForm(data) {
  return request({
    url: '/api/form/editForm',
    method: 'post',
    data,
  });
}
// 删除附件
export function deleteFile(data) {
  return request({
    url: api.deleteFile,
    method: 'post',
    data,
  });
}
// 保存表单数据
export function saveFormDataValue(data) {
  return request({
    url: '/api/formData/saveFormDataValue',
    method: 'post',
    data,
  });
}
